using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Input;

namespace LayoutPlanning.Converters
{
    public class DrawTypeToCursor : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            
            var v = (int) value;
            
            return v >0 ? Cursors.Cross : Cursors.Arrow;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (!(value is Cursor))
                return null;
            var v = (Cursor) value;

            return Cursors.Arrow != v;
        }
    }
}